//
//  NSArray+SafeAccess.h
//  category
//
//  Created by MAC on 2018/5/5.
//  Copyright © 2018年 MAC. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NSArray (SafeAccess)
- (id)ex_objectWithIndex:(NSUInteger)index;

- (NSString*)ex_stringWithIndex:(NSUInteger)index;

- (NSNumber*)ex_numberWithIndex:(NSUInteger)index;

- (NSDecimalNumber *)ex_decimalNumberWithIndex:(NSUInteger)index;

- (NSArray*)ex_arrayWithIndex:(NSUInteger)index;

- (NSDictionary*)ex_dictionaryWithIndex:(NSUInteger)index;

- (NSInteger)ex_integerWithIndex:(NSUInteger)index;

- (NSUInteger)ex_unsignedIntegerWithIndex:(NSUInteger)index;

- (BOOL)ex_boolWithIndex:(NSUInteger)index;

- (int16_t)ex_int16WithIndex:(NSUInteger)index;

- (int32_t)ex_int32WithIndex:(NSUInteger)index;

- (int64_t)ex_int64WithIndex:(NSUInteger)index;

- (char)ex_charWithIndex:(NSUInteger)index;

- (short)ex_shortWithIndex:(NSUInteger)index;

- (float)ex_floatWithIndex:(NSUInteger)index;

- (double)ex_doubleWithIndex:(NSUInteger)index;

- (NSDate *)ex_dateWithIndex:(NSUInteger)index dateFormat:(NSString *)dateFormat;

//CG
- (CGFloat)ex_CGFloatWithIndex:(NSUInteger)index;

- (CGPoint)ex_pointWithIndex:(NSUInteger)index;

- (CGSize)ex_sizeWithIndex:(NSUInteger)index;

- (CGRect)ex_rectWithIndex:(NSUInteger)index;
@end


#pragma --mark NSMutableArray setter

@interface NSMutableArray(SafeAccess)

-(void)ex_addObj:(id)aObj;

-(void)ex_addString:(NSString*)aString;

-(void)ex_addBool:(BOOL)aBoolValue;

-(void)ex_addInt:(int)aIntValue;

-(void)ex_addInteger:(NSInteger)aIntegerValue;

-(void)ex_addUnsignedInteger:(NSUInteger)aUInterValue;

-(void)ex_addCGFloat:(CGFloat)aFloatValue;

-(void)ex_addChar:(char)aCharValue;

-(void)ex_addFloat:(float)aFloatValue;

-(void)ex_addPoint:(CGPoint)aPointValue;

-(void)ex_addSize:(CGSize)aSize;

-(void)ex_addRect:(CGRect)aRect;
@end
